1 ================================================================================
2 WINDOWS FORMS APPLICATION : CSWinFormControls Project Overview
4 Control Customization Sample
6 ===============================================================================
8 /////////////////////////////////////////////////////////////////////////////
11 The Control Customization sample demonstrates how to customize the Windows Forms
14 In this sample, there're 4 examples:
16 1. Multiple Column ComboBox.
17 Demonstrates how to display multiple columns of data in the dropdown of a ComboBox.
18 2. ListBox Items With Different ToolTips.
19 Demonstrates how to display different tooltips on each items of the ListBox.
20 3. Numeric-only TextBox.
21 Demonstrates how to make a TextBox only accepts numbers.
23 Demonstrates how to create a Button with irregular shape.
26 /////////////////////////////////////////////////////////////////////////////
29 1. Example 1: "Multiple Column ComboBox".
31 1). Create a DataTable with several columns and rows of data;
32 2). Data bind the ComboBox control to the DataTable;
33 3). Enable the owner draw on ComboBox by setting the DrawMode property to
34 DrawMode.OwnerDrawFixed;
35 4). Handle the DrawItem event on the ComboBox;
36 5). In the DrawItem event handler, compute the bounds for each column and
37 draw corresponding value for each column on its bounds.
39 2. Example 2: "ListBox Items With Different ToolTips".
41 1). Add some items to the ListBox control;
42 2). Handle the MouseMove event on the ListBox control;
43 3). Call the ListBox.IndexFromPoint method to retrieve the item index at
44 where the mouse hovers;
45 4). If the mouse is over the items, call ToolTip.SetToolTip method to display
46 a tooltip for the individual item.
48 3. Example 3: "Numeric-only TextBox".
50 The make a TextBox accepts only numbers, we can handle the TextBox.KeyPress
51 event, in the event handler use char.IsNumber method to filter the input keys.
53 4. Example 4: "A Round Button".
55 The key point of creating a round button is changing its Region property.
58 /////////////////////////////////////////////////////////////////////////////
61 1. Windows Forms General FAQ.
62 http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/77a66f05-804e-4d58-8214-0c32d8f43191
64 2. Shaped Windows Forms and Controls in Visual Studio .NET
65 http://msdn.microsoft.com/en-us/library/aa289517.aspx
68 http://www.codeproject.com/KB/buttons/RoundButton_csharp.aspx
71 /////////////////////////////////////////////////////////////////////////////